import checkAll from '../checkAll/index.js'
import doErro from '../doErro/index.js'

function doCommit(parms) {
	let result = true;
	for (let key in parms) {
		if (key == 'phone_pwd' || key == 'phonePwd') {
			//console.log("parms['phone_pwd']" + parms['phone_pwd']);
			//console.log("parms['phonePwd']" + parms['phonePwd']);
			if (parms['phone_pwd'] == '' || parms['phone_pwd'] != parms['phonePwd']) {
				doErro.showErro('phonePwd');
				result = false;
				//console.log(123);
				break;
				return;
			}
		} else {
			if (!checkAll.checkTest(parms[key], key)) {
				//console.log(key);
				//console.log(parms[key]);
				doErro.showErro(key);
				result = false;
				break;
				return;
			}
			//console.log(123);
		}
	}
	return result;
}
export default {
	doCommit
}